var gulp = require('gulp');
var elixir = require('laravel-elixir');
var assetsPath = Elixir.config.assetsPath;


// config
elixir.config.sourcemaps = false;
elixir.config.browserSync = {
    reloadOnRestart: true
};


// style
elixir(function(mix) {
    mix.less('bootstrap/bootstrap.less', 'public/css/bootstrap.css')
        .less('index.less');
});


// script
elixir(function(mix) {
    mix.scripts([
            'lib/bootstrap/jquery.js',
            'lib/bootstrap/bootstrap.js',
            'lib/angular/angular.js',
            'lib/angular/angular-route.js',
            'lib/angular/angular-loading-bar.js'
        ], 'public/js/lib.js')
        .scripts([
            'index.js',
            'controllers/ctrl.index.demo.js'
        ], 'public/js/index.js');
});


// html
elixir(function(mix) {
    mix.copy('resources/views', 'public/views')
        .copy('resources/pages/index.html', 'public/index.html');
});


// others
elixir(function (mix) {
    mix.copy('resources/imgs', 'public/imgs')
        .copy('resources/assets/less/i', 'public/css/i')
        .copy('resources/assets/less/fonts', 'public/css/fonts')
        .copy('package.json', 'public/package.json');
});

// version
/*elixir(function (mix) {
    mix.version([
            'public/css/index.css', 
            'public/js/lib.js', 
            'public/js/index.js'
        ])
        .message('version success!');
});*/